<?php 
		$links=Episode::model()->findAll(
    			array(
    				'condition'=>'t.eid = '.$data->id,
    			)
    	);
		$i=0;
?>
<div class="episodeview">
	<label><?php echo $data->name;?></label>
	<?php foreach($links as $link):?>
		<?php if($i==0):?>
		<a title="<?php echo $link->name;?>" data="<?php echo $data->en_name.$link->link;?>" class="link"><?php echo $link->name;?></a>
		<?php 
		$i++;
		else:?>
		<a title="<?php echo $link->name;?>" href="<?php echo Yii::app()->createUrl('film/view',array('id'=>$data->fid));?>" class="link"><?php echo $link->name;?></a>
		<?php endif;?>
	<?php endforeach;?>
</div> 